package com.dews.web.controller.warn;


import com.dews.common.core.controller.BaseController;
import com.dews.common.core.domain.BaseResponse;
import com.dews.warn.domain.ro.StuCreditRo;
import com.dews.warn.service.DataStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风学Java
 * @version 1.0.0
 * @date 2025/2/6
 */
@Api(value = "数据统计", tags = {"数据统计" })
@RestController
@RequestMapping("/data/statistics")
public class DataStatisticsController  extends BaseController {

    private DataStatisticsService dataStatisticsService;

    @Autowired
    public DataStatisticsController(DataStatisticsService dataStatisticsService) {
        this.dataStatisticsService = dataStatisticsService;
    }

    @ApiOperation(value = "学生每学期学分修读情况")
    @PreAuthorize("@ss.hasPermi('data:statistics:stuCredit')")
    @GetMapping("/stu/credit")
    public BaseResponse statisticsDegreeGrade() {
        StuCreditRo stuCreditRo = dataStatisticsService.statisticsDegreeGrade();
        return success(stuCreditRo);
    }

    @ApiOperation(value = "学生每学期学分绩点修读情况")
    @PreAuthorize("@ss.hasPermi('data:statistics:stuGradePoint')")
    @GetMapping("/stu/gradePoint")
    public BaseResponse statisticsStuGradePoint() {
        StuCreditRo stuCreditRo = dataStatisticsService.statisticsStuGradePoint();
        return success(stuCreditRo);
    }


    @ApiOperation(value = "查询各年级学生学分修读情况")
    @PreAuthorize("@ss.hasPermi('data:statistics:gradeCredit')")
    @GetMapping("/grade/credit")
    public BaseResponse statisticsGradeCredit() {
//        StuCreditRo stuCreditRo = dataStatisticsService.statisticsGradeCredit();
        return success(null);
    }

}
